<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>沂水旅游-跟团游列表</title>
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">

    <link rel="stylesheet" href="/static/layuiadmin/layui/css/layui.css">
    <link rel="stylesheet" href="/static/index/css/base.css">
    <link rel="stylesheet" href="/static/index/css/gentuanyouList.css">
</head>
<body>

{include file="public/header" model='group' /}

<div class="searchBox">

    <div class="layui-container">
        <div class="mianbaoxie-nav">
            <span class="layui-breadcrumb">
              <a href="/">首页</a>
              <a><cite>跟团游列表</cite></a>
            </span>
        </div>

        <div class="layui-row">
            <div class="layui-col-md8">
                <div class="layui-row">
                    <div class="layui-col-md2">
                        <a href="{:url('group/groupList')}">
                            <div class="search-kind-box">
                                <div class="kinds-icon kinds-icon-1 group-kinds-icon-0"></div>
                                <div class="kinds-title">所有类型</div>
                            </div>
                        </a>
                    </div>
                    <div class="layui-col-md2">
                        <a href="{:url('group/groupList')}?kinds=1">
                            <div class="search-kind-box">
                                <div class="kinds-icon kinds-icon-1 group-kinds-icon-1"></div>
                                <div class="kinds-title">一日游</div>
                            </div>
                        </a>
                    </div>
                    <div class="layui-col-md2">
                        <a href="{:url('group/groupList')}?kinds=2">
                            <div class="search-kind-box">
                                <div class="kinds-icon kinds-icon-1 group-kinds-icon-2"></div>
                                <div class="kinds-title">多日游</div>
                            </div>
                        </a>
                    </div>

                </div>
            </div>
        </div>

    </div>
</div>

<div class="lookup">
    <form class="layui-form" method="post" action="{:url('groupList')}">
        <div class="layui-container">
            <div class="lookup_cen">
                <div class="layui-row">
                    <div class="layui-col-md7">
                        <div class="layui-row">
                            <div class="layui-col-md2">
                                <p class="s-label">条件搜索</p>
                            </div>
                            <div class="layui-col-md7">
                                <div class="checkIn-box">
                                    <div class="checkIn checkInTime">
                                        <div class="time-label">出游时间：</div>
                                        <div class="time-input">
                                            <input type="text" class="checkInTimeInput" id="checkInTimeStart" readonly/>
                                            -
                                            <input type="text" class="checkInTimeInput" id="checkInTimeEnd" readonly/>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-md5">
                        <div class="layui-row">

                            <div class="layui-col-md5 layui-col-lg-offset4">
                                <div class="checkIn-box">
                                    <div class="checkIn searchKeywords-box">
                                        <input type="text" name="title" placeholder="输入关键词" class="searchKeywords">
                                    </div>
                                </div>
                            </div>
                            <div class="layui-col-md3">
                                <div class="checkIn-box">
                                    <div class="checkIn checkButton-box">
                                        <button class="checkButton">搜索</button>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </form>
</div>

<div class="layui-container gentuanyou">
    {notempty name="list"}
    <div class="layui-row layui-col-space12">
        {foreach $list as $key => $value}

        <div class="layui-col-md4 ">
            <a href="{:url('group/group',['id'=>$value['id']])}">
            <div class="layui-row">
                <div class="layui-col-md5 layui-col-xs5">
                    <div class="gentuanyou_img">
                        <img src="{$value.gtour_covers}" alt="">

                        {if $value.gtour_days == 1}
                        <span class="one-you">一日游</span>
                        {else/}
                        <span class="more-you">多日游</span>
                        {/if}
                    </div>
                </div>
                <div class="layui-col-md7 layui-col-xs7">
                    <div class="gentuanyou_info">
                        <div class="gentuanyou_info_title">

                                {$value.gtour_title}

                        </div>
                        <div class="gentuanyou_info_price">
                            <b>￥</b><span>{$value.gtour_price}</span>
                        </div>

                        <div class="gentuanyou_info_num">
                            已售<span>{$value.sale_sum}</span>
                        </div>
                    </div>
                </div>
            </div>
            </a>
        </div>
        {/foreach}
    </div>
    {else/}
    <div class="layui-row">
        <div style="width: 100%;height: 300px;text-align: center;line-height: 300px;color: #5c5c5c;background: #fcfcfc">
            暂无数据
        </div>
    </div>
    {/notempty}

    <div class="pageOption" style="padding: 20px  0">
        {$groupList->render()}
    </div>

</div>


<div style="height: 50px;"></div>

{include file="public/footer" /}
<script>
    var $ = layui.jquery;
        var layer = layui.layer
            , element = layui.element
            , carousel = layui.carousel
            , flow = layui.flow
            , laydate = layui.laydate
            , form = layui.form;

        flow.lazyimg();
        element.init();

        //入住时间

        //今天的时间
        var todayObj = new Date();
        todayObj.setTime(todayObj.getTime());

        todayDay = todayObj.getDate();
        if (todayDay < 10) {
            todayDay = '0' + todayDay;
        }

        todayMoth = todayObj.getMonth() + 1;

        if (todayMoth < 10) {
            todayMoth = '0' + todayMoth;
        }

        var today = todayObj.getFullYear() + "-" + todayMoth + "-" + todayDay;

        //明天的时间
        var tomorrowObj = new Date();
        tomorrowObj.setTime(tomorrowObj.getTime() + 24 * 60 * 60 * 1000);
        tomorrowDay = tomorrowObj.getDate();
        if (tomorrowDay < 10) {
            tomorrowDay = '0' + tomorrowDay;
        }
        tomorrowMonth = tomorrowObj.getMonth() + 1;

        if (tomorrowMonth < 10) {
            tomorrowMonth = '0' + tomorrowMonth;
        }
        var tomorrow = tomorrowObj.getFullYear() + "-" + tomorrowMonth + "-" + tomorrowDay;
        laydate.render({
            elem: '#checkInTimeStart' //指定元素
            , value: today
        });

        laydate.render({
            elem: '#checkInTimeEnd' //指定元素
            , value: tomorrow
        });

        function getQueryVariable(variable) {
            var query = window.location.search.substring(1);
            var vars = query.split("&");
            for (var i = 0; i < vars.length; i++) {
                var pair = vars[i].split("=");
                if (pair[0] == variable) {
                    return pair[1];
                }
            }
            return (false);
        }

        var kinds = getQueryVariable('kinds');

        if (kinds) {
            switch (kinds * 1) {
                case 1:
                    $('.group-kinds-icon-1').parent().addClass('search-kind-box-active');
                    break;
                case 2:
                    $('.group-kinds-icon-2').parent().addClass('search-kind-box-active');
                    break;

                default:
                    $('.group-kinds-icon-0').parent().addClass('search-kind-box-active');

            }

        } else {

            $('.group-kinds-icon-0').parent().addClass('search-kind-box-active');

        }
</script>
</body>
</html>